﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Example_virtual_abstract
{
    public abstract class Talk
    {
        public abstract void speak();
        public virtual void goodbye()
        {
            Console.WriteLine("Says goodbye 1!");
        }
    }
    public class SayHello : Talk
    {
        public override void speak()
        {
            Console.WriteLine("Says Hello 2!");
        }
        public override void goodbye()
        {
            Console.WriteLine("Says goodbye 2!");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Talk hello = new SayHello();
           
            hello.speak();
            hello.goodbye();
        }
    }
}
